﻿using ALMDDD.Domain.Core.Events;
using System;
using System.Collections.Generic;
using System.Text;

namespace ALMDDD.Domain.Core.Notifications
{
    /// <summary>
    /// 领域通知模型，用来获取当前总线中出现的通知信息
    /// 继承自领域事件和INotification(中介的发布/订阅模式)
    /// </summary>
    public class DomainNotification : Event
    {

        public DomainNotification(string key, string value)
        {

            DomainNotificationId = Guid.NewGuid();
            Version = 1;
            Key = key;
            Value = value;

        }
        /// <summary>
        /// 唯一标识
        /// </summary>
        public Guid DomainNotificationId { get; private set; }
        /// <summary>
        /// 键
        /// </summary>
        public string Key { get; private set; }
        /// <summary>
        /// 值
        /// </summary>
        public string Value { get; private set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; private set; }
    }
}
